﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sexybeauty.Core.Inf.Entities.Table;

namespace Sexybeauty.Core.Inf.LogicEntity
{
    public class DiscussEntity : IAccessible<Discuss,DiscussEntity>
    {
        #region Fileds
        public int Id { get; set; }
        public DiscussType DisType { get; set; }
        public int RefId { get; set; }
        /// <summary>
        /// 评价 0：差评 1：中评 2：好评
        /// </summary>
        public Opinion Opinion { get; set; }
        public string Message { get; set; }
        public DateTime RcdDate { get; set; }
        #endregion

        protected override void Covariant(Discuss dbModel)
        {
            this.Id = dbModel.Id;
            this.DisType = (DiscussType)dbModel.DisType;
            this.RefId = dbModel.RefId;
            this.Opinion = (LogicEntity.Opinion)dbModel.Opinion;
            this.Message = dbModel.Message;
            this.RcdDate = dbModel.RcdDate;
        }
        protected override Discuss Inverter(DiscussEntity model)
        {
            return new Discuss()
            {
                DisType = (int)model.DisType,
                Id = model.Id,
                Message = model.Message,
                Opinion = (int)model.Opinion,
                RcdDate = model.RcdDate,
                RefId = model.RefId
            };
        }
    }
}
